{% extends "basic.html" %}
{% block mainbody %}
<img src="/common_static/logo.png" class="img-rounded center-block">
<h5 class="text-center">超额宝后台管理系统</h5>

<form id="form1" class="form-horizontal" role="form" method="POST" action="/ckpwd">
  {% csrf_token %}
  <div class="form-group">
    <label for="firstname" class="col-sm-2 control-label">登录名：</label>
    <div class="col-sm-10">
      <div class="input-group">
        <span class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>
        <input type="text" class="form-control" name="username" value="{{ info.personal_netpay }}">
      </div>
    </div>
  </div>
  <div class="form-group">
    <label for="firstname" class="col-sm-2 control-label">密码：</label>
    <div class="col-sm-10">
      <div class="input-group">
        <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
        <input type="password" class="form-control" name="pwd" value="{{ info.company_netpay }}">
      </div>
    </div>
  </div>
  
  <div id="btn_submit_fixed_bootom" class="form-group navbar-fixed-bottom" style="margin:5px;">
    <button type="submit" class="btn btn-primary btn-lg btn-block">提交</button>
  </div>
  <script type="text/javascript">document.write( '<style>div#btn_submit_fixed_bootom{visibility:hidden}@media(min-height:' + ($( window ).height() - 10) + 'px){div#btn_submit_fixed_bootom{visibility:visible}}</style>' );</script>
  
  
</form>
<script type="text/javascript">
$(document).ready(function(){
  //return true;
  $("#form1").submit(function(){
    var data=$(this).serialize();
    var url=$(this).attr("action");
    var tips=art.dialog.tips("正在提交验证……");
    
    $.ajax({
      async:false,
      type:'POST',
      url:url,
      data:data,
      success:function(rsObj){
        if(rsObj.response_code=="1"){
          art.dialog.tips("验证通过，正在进入后台……");
          setTimeout(function(){
            window.location.href="/";
          },1000);
        }else{
          art.dialog.alert(rsObj.response_message);
        }
      },
      cache:false
    });
    return false;
  });
});
</script>

{% endblock %}

